/*
 * QE3e Qt Quick 3D Engine.
 * Copyright (C) 2010 Joris Vaillant and Mathieu Pujol
 * <joris.vaillant@gmail.com>  <mathieu.pujol87@gmail.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#ifndef MESH_H
#define MESH_H

//qe3e
#include <qe3e_global.h>

//Qt
#include <QSharedData>
#include <QSharedDataPointer>
#include <QString>

namespace qe3e
{
  class MeshPrivate;

  class QE3E_EXPORT Mesh
  {
  public:
    Mesh();
    Mesh(const Mesh & mesh);

    virtual void draw(int nbOfTexture) const;

    virtual QString type() const {return "Mesh";};

  /** @todo //protected:  */
    void setNumberOfFaces(int nb);
    void setIndexArray(int * indexes);
    void setVertexArray(float * vertexArray);
    void setTexCoordArray(float * texCoordArray);
    void setNormalArray(float * normalArray);

    void debug() const;

  private:
    QSharedDataPointer<MeshPrivate> mData;
  };

  class MeshPrivate : public QSharedData
  {
  public:
    MeshPrivate();
    ~MeshPrivate();

    int mFaceNb;
    int * mIndex;
    float * mVertex;
    float * mTexCoord;
    float * mNormal;
  };
}

#endif // MESH_H
